home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / complib / cscalm1d.z / cscalm1d
Text File  |  1998-10-30  |  7KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccssssccccaaaallllmmmm1111dddd,,,,zzzzssssccccaaaallllmmmm1111dddd((((3333FFFF))))                                    ccccssssccccaaaallllmmmm1111dddd,,,,zzzzssssccccaaaallllmmmm1111dddd((((3333FFFF))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ccccssssccccaaaallllmmmm1111dddd,,,, zzzzssssccccaaaallllmmmm1111dddd ---- scales Multiple 1D complex sequences.
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSYYYYSSSS
  12.      _F_o_r_t_r_a_n :
  13.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee ccccssssccccaaaallllmmmm1111dddd(((( nnnn,,,, pppp,,,, aaaallllpppphhhhaaaa,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, llllddddaaaa))))
  14.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, pppp,,,, iiiinnnncccc,,,, llllddddaaaa
  15.           rrrreeeeaaaallll               aaaallllpppphhhhaaaa
  16.           ccccoooommmmpppplllleeeexxxx            aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,pppp))))
  17.      ssssuuuubbbbrrrroooouuuuttttiiiinnnneeee zzzzssssccccaaaallllmmmm1111dddd(((( ssssiiiiggggnnnn,,,, nnnn,,,, pppp,,,, aaaarrrrrrrraaaayyyy,,,, iiiinnnncccc,,,, llllddddaaaa))))
  18.           iiiinnnntttteeeeggggeeeerrrr            nnnn,,,, pppp,,,, iiiinnnncccc,,,, llllddddaaaa
  19.           rrrreeeeaaaallll****8888             aaaallllpppphhhhaaaa
  20.           ddddoooouuuubbbblllleeee ccccoooommmmpppplllleeeexxxx     aaaarrrrrrrraaaayyyy((((llllddddaaaa,,,,pppp))))
  21.  
  22.      _C :
  23.      ####iiiinnnncccclllluuuuddddeeee <<<<fffffffftttt....hhhh>>>>
  24.      iiiinnnntttt ccccssssccccaaaallllmmmm1111dddd (((( iiiinnnntttt nnnn,,,, iiiinnnntttt pppp,,,, ffffllllooooaaaatttt aaaallllpppphhhhaaaa,,,, ccccoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,
  25.                iiiinnnntttt iiiinnnncccc,,,, iiiinnnntttt llllddddaaaa))));;;;
  26.      iiiinnnntttt zzzzssssccccaaaallllmmmm1111dddd (((( iiiinnnntttt nnnn,,,, iiiinnnntttt pppp,,,, ddddoooouuuubbbblllleeee aaaallllpppphhhhaaaa,,,, zzzzoooommmmpppplllleeeexxxx ****aaaarrrrrrrraaaayyyy,,,,
  27.                iiiinnnntttt iiiinnnncccc,,,, iiiinnnntttt llllddddaaaa))));;;;
  28.  
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      ccccssssccccaaaallllmmmm1111dddd and zzzzssssccccaaaallllmmmm1111dddd scale the P complex sequences of N samples each.
  32.      The Fourier Transforms are not normalized so the succession Direct-
  33.      Inverse transform scales the input data by a factor equal to the size of
  34.      the transform.  ccccssssccccaaaallllmmmm1111dddd or zzzzssssccccaaaallllmmmm1111dddd are used to scale back the result.
  35.  
  36. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  37.      NNNN ---- Integer, the number of samples in each sequence.
  38.      Unchanged on exit.
  39.  
  40.      PPPP ---- Integer, the number of sequences.  Unchanged on exit.
  41.  
  42.      AAAAllllpppphhhhaaaa ---- scaling floating point value.  Unchanged on exit.
  43.  
  44.      AAAARRRRRRRRAAAAYYYY ---- Array containing the samples of the sequence to be scaled (in
  45.      place).
  46.  
  47.      IIIINNNNCCCC ---- Integer, increment between two consecutive elements of a sequence.
  48.      Unchanged on exit.
  49.  
  50.      LLLLDDDDAAAA ---- Integer, leading dimension: increment between the first samples of
  51.      two consecutive sequences.  Unchanged on exit.
  52.  
  53.  
  54. EEEExxxxaaaammmmpppplllleeee ooooffff CCCCaaaalllllllliiiinnnngggg SSSSeeeeqqqquuuueeeennnncccceeee
  55.      Working on 64 sequences of 1024 complex values each.  We successively
  56.      apply a Direct Fourier Transform, an Inverse Fourier Trasnform and
  57.      finally scale back the result by a factor 1/N (1/1024.)-
  58.      This sequence DirectFFT-InverseFFT-Scaling is equivalent to the identity
  59.      operator and the final sequence should be equal (with round-off
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccssssccccaaaallllmmmm1111dddd,,,,zzzzssssccccaaaallllmmmm1111dddd((((3333FFFF))))                                    ccccssssccccaaaallllmmmm1111dddd,,,,zzzzssssccccaaaallllmmmm1111dddd((((3333FFFF))))
  71.  
  72.  
  73.  
  74.      precision) to the initial sequence.
  75.      Elements of each sequence are stored with increment (stride) 1, and the
  76.      offset between the first element of two succesive sequence (leading
  77.      dimension) is 2049.
  78.      FFFFoooorrrrttttrrrraaaannnn ::::
  79.           complex array(0:2049-1,0:64-1), coeff(1024+15)
  80.           call cfftm1di( 1024, coeff)
  81.           call cfftm1d( -1, 1024, 64, array, 1, 2049, coeff)
  82.           call cfftm1d(  1, 1024, 64, array, 1, 2049, coeff)
  83.           call cscalm1d(1024,64,(1./real(1024)),array,1,2049)
  84.  
  85.      CCCC ::::
  86.           #include <fft.h>
  87.           complex array[64*2049], *coeff;
  88.           coeff = cfftm1di( 1024, NULL);
  89.           cfftm1d( -1, 1024, 64, array, 1, 2049, coeff);
  90.           cfftm1d(  1, 1024, 64, array, 1, 2049, coeff);
  91.           cscalm1d( 1024, 64, 1./(float)1024, array, 1, 2049);
  92.  
  93.      NNNNOOOOTTTTEEEE____1111 :::: The Direct and Inverse transforms should use opposite signs -
  94.      Which one is used (+1 or -1) for Direct transform is just a matter of
  95.      convention-
  96.  
  97.      NNNNOOOOTTTTEEEE____2222 :::: The Fourier Transforms are not normalized so the succession
  98.      Direct-Inverse transform scales the input data by a factor equal to the
  99.      size of the transform.
  100.  
  101. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  102.      fft, cfftm1di, zfftm1di, cfftm1d, zfftm1d, cprodm1d, zprodm1d
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.